<template>
    <div class="search">
        <van-search v-model="value" show-action placeholder="请输入搜索关键词" @search="onSearch" @cancel="onCancel" />
        <van-cell-group>

            <router-link to="/stadydone" v-for="(item, index) in search()" :key="index">
                <van-cell :title="item.name" @click="lockworld(item.id)" />
            </router-link>
        </van-cell-group>
    </div>
</template>

<script>

export default {
    props: ['cet4list'],
    data() {
        return {
            value: '',
        };
    },
    methods: {
        onSearch() {
            // Toast(val);
        },
        onCancel() {
            // Toast('取消');
            this.$router.go(-1)
        },
        search() {
            if (this.value != '') {
                return this.cet4list.filter(item => item.name.includes(this.value))
            }
        },
        lockworld(id) {
            this.$emit("lockworld", id);
        }
    },

};
</script>

<style lang="scss" scoped>
.van-search__content {
    border-radius: 30px;
}

.van-field__control {
    color: #ff6c08;
}

.van-search__action {
    font-size: 14px;
    color: #323232;
}

.search {


    min-height: 667px;
    background-color: #fff;
}
</style>